#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int main()
{
	float pi=3.14,th1,th2;
	int left,right,radius,bottom,centerx,centery,top,i,n,h,j;
	COLORREF color1,color2;
	initgraph(600,600);
	setbkcolor(RGB(128,128,128));
	cleardevice();
	th1=0;
	th2=pi/30.0;
	while(1)
	{
		centerx=-100;
		centery=-100;
		radius=100;
		left=centerx-radius;
		right=centerx+radius;
		top=centery-radius;
		bottom=centerx+radius;
		for(j=1;j<=3;j++)
		{
			centery=centery+200;
			centerx=-100;
			for(h=1;h<=3;h++)
			{
				centerx=centerx+200;
				radius=125;
				float k=rand()%240;
				color1=HSVtoRGB(k,0.9,0.8);
				color2=HSVtoRGB(k+120,0.5,0.5);
				for(n=1;n<=4;n++)
				{
					radius=radius-25;
					left=centerx-radius;
					right=centerx+radius;
					top=centery-radius;
					bottom=centery+radius;
					th1=th1+pi/20.0;
					th2=th2+pi/20.0;
					for(i=1;i<=20;i++)
					{
						setlinecolor(RED);
						setfillcolor(color1);
						solidpie(left,top,right,bottom,th1,th2);
						th1=th1+pi/30.0;
						th2=th2+pi/60.0;
						setfillcolor(RGB(255,255,255));
						solidpie(left,top,right,bottom,th1,th2);
						th1=th1+pi/60.0;
						th2=th2+pi/30.0;
						setfillcolor(color2);
						solidpie(left,top,right,bottom,th1,th2);
						th1=th1+pi/30.0;
						th2=th2+pi/60.0;
						setfillcolor(RGB(0,0,0));
						solidpie(left,top,right,bottom,th1,th2);
						th1=th1+pi/60.0;
						th2=th2+pi/30.0;
					}
				}
			}
		}
		getch();
	}
	return 0;
}